package com.springBoot.initializer;

import org.springframework.boot.context.event.ApplicationFailedEvent;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

public class Aaaa implements ApplicationListener {
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        //ApplicationEvent event 就是对应的法布类，
        if (event instanceof ApplicationReadyEvent) {
            System.out.println("chushihua cgong!!!");
        }
        if (event instanceof ApplicationFailedEvent) {
            System.out.println("chushihua shibai!!!");
        }
    }
}
